Skip to content

refactor(@inquirer/core): replace wrap-ansi with fast-wrap-ansi#1981

Merged
SBoudrias merged 2 commits intoSBoudrias:mainfrom
njg7194:replace-wrap-ansi-with-fast-wrap-ansi
Feb 3, 2026
Merged

refactor(@inquirer/core): replace wrap-ansi with fast-wrap-ansi#1981
SBoudrias merged 2 commits intoSBoudrias:mainfrom
njg7194:replace-wrap-ansi-with-fast-wrap-ansi

Conversation

@njg7194
Copy link
Contributor

@njg7194 njg7194 commented Feb 1, 2026

Summary

This PR replaces wrap-ansi with fast-wrap-ansi in @inquirer/core.

Changes

  • Replace wrap-ansi dependency with fast-wrap-ansi
  • Update import statement to use named export

Why?

As mentioned in #1799, fast-wrap-ansi claims to be:

  • 10x faster than wrap-ansi (benchmarks included in the repo)
  • Half the size of wrap-ansi
  • Supports Node.js 18+, which aligns with @inquirer/core's requirements

Compatibility

fast-wrap-ansi supports the same options as wrap-ansi:

  • trim
  • wordWrap
  • hard

The only difference is the export style (named vs default), which has been updated accordingly.

Closes #1799

njg7194 and others added 2 commits February 1, 2026 15:48
Replaces wrap-ansi with fast-wrap-ansi for improved performance.
fast-wrap-ansi claims to be 10x faster while being half the size.

Closes SBoudrias#1799
Update the lockfile to include the new fast-wrap-ansi dependency
and properly remove wrap-ansi from @inquirer/core.
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@099e0ee). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1981   +/-   ##
=======================================
  Coverage        ?   94.85%           
=======================================
  Files           ?       37           
  Lines           ?     1555           
  Branches        ?      456           
=======================================
  Hits            ?     1475           
  Misses          ?       78           
  Partials        ?        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SBoudrias
Copy link
Owner

Thanks! Do you know if this lib is tracking this bug from wrap-ansi? #1943

@SBoudrias SBoudrias merged commit 7483749 into SBoudrias:main Feb 3, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider replacing wrap-ansi with fast-wrap-ansi

2 participants